using System;
using System.Collections.Generic;
using System.Text;

using Mud.Common.Physical;

namespace Mud.Client
{
    public class Creature : GameObject
    {

        #region Events

        /// <summary>
        /// Handler for creature movement.
        /// </summary>
        /// <param name="o">Creature that is moving.</param>
        /// <param name="target">Creature target location.</param>
        /// <param name="movementType">Type of movement.</param>
        public delegate void CreatureMoving(GameObject o, Location target, MovementType movementType);

        /// <summary>
        /// Occurs when creature starts to move.
        /// </summary>
        public event CreatureMoving MovingStarted;

        public event CreatureMoving MovingEnded;

        #endregion

        public Creature(int objectId) : base(objectId) { }


        /// <summary>
        /// Starts the creature movement.
        /// </summary>
        /// <param name="target">The target location.</param>
        /// <param name="type">The type of movement..</param>
        internal void StartMoving(Location target, MovementType type) 
        {
            if (MovingStarted != null)
                MovingStarted(this, target, type);
        }


        /// <summary>
        /// Ends the creature movement.
        /// </summary>
        /// <param name="target">The arrived location.</param>
        /// <param name="type">The type of movement..</param>
        internal void EndMoving(Location target, MovementType type)
        {
            if (MovingEnded != null)
                MovingEnded(this, target, type);
        }

    }
}
